package model

import "fmt"

type Account struct {
	//账号
	accountNumber string
	deposit       float64
	password      string
}

func (a *Account) GetPassword() string {
	return a.password
}

func (a *Account) SetPassword(password string) {
	if len(password) == 6 {
		a.password = password
	} else {
		fmt.Println("密码必须是6位数")
		return
	}
}

func (a *Account) GetDeposit() float64 {
	return a.deposit
}

func (a *Account) SetDeposit(deposit float64) {
	if deposit > 10 {
		a.deposit = deposit
	} else {
		fmt.Println("存款必须大于20元")
		a.deposit = 20
		return
	}

}

func (a *Account) GetAccountNumber() string {
	return a.accountNumber
}

func (a *Account) SetAccountNumber(accountNumber string) {
	if len(accountNumber) > 6 && len(a.accountNumber) < 10 {
		a.accountNumber = accountNumber
	} else {
		fmt.Println("您设置的账户名位数不符合要求")
		return
	}
}
